package com.lyw.gulimall.ware.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lyw.gulimall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lyw.gulimall.ware.vo.SkuHasStockVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 * 
 * @author liyawei
 * @email liyawei@gmail.com
 * @date 2022-05-31 12:20:13
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    IPage<Map<String, Object>> selectWareskuPage(Page<WareSkuEntity> result,@Param(Constants.WRAPPER) LambdaQueryWrapper<WareSkuEntity> lqw);

    void addStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("skuNum") Integer skuNum);

    List<SkuHasStockVo> selectSkuStock(@Param("skuIds") List<Long> skuIds);
}
